home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Source.bin / LabelHTMLLinkBeanInfo.java < prev    next >
Text File  |  1998-08-21  |  3KB  |  92 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.beans.*;
  4. import symantec.itools.beans.*;
  5. import java.util.ResourceBundle;
  6.  
  7. //  09/13/97    LAB    Removed extranious getPropertyDescriptors method and
  8. //                    removed getMethodDescriptors method.
  9. //  11/17/97    CAR Added getMethodDescriptors in order to "hide" methods from introspection.
  10. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  11.  
  12.  
  13. /**
  14.  * BeanInfo for LabelHTMLLink.
  15.  *
  16.  */
  17. public class LabelHTMLLinkBeanInfo extends SimpleBeanInfo {
  18.  
  19.     /**
  20.      * Constructs a LabelHTMLLinkBeanInfo object.
  21.      */
  22.     public LabelHTMLLinkBeanInfo() {
  23.     }
  24.  
  25.     /**
  26.      * Gets a BeanInfo for the superclass of this bean.
  27.      * @return BeanInfo[] containing this bean's superclass BeanInfo
  28.      */
  29.     public BeanInfo[] getAdditionalBeanInfo() {
  30.         try {
  31.             BeanInfo[] bi = new BeanInfo[1];
  32.             bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
  33.             return bi;
  34.         }
  35.         catch (IntrospectionException e) { throw new Error(e.toString());}
  36.     }
  37.  
  38.     /**
  39.      * Gets the SymantecBeanDescriptor for this bean.
  40.      * @return an object of type SymantecBeanDescriptor
  41.      * @see symantec.itools.beans.SymantecBeanDescriptor
  42.      */
  43.     public BeanDescriptor getBeanDescriptor() {
  44.         ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
  45.         String s=group.getString("GroupAWTAdditions");
  46.  
  47.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  48.         bd.setFolder(s);
  49.         bd.setWinHelp("0x123A5");
  50.  
  51.         bd.addAdditionalConnections(getAdditionalBeanInfo());
  52.  
  53.         return (BeanDescriptor) bd;
  54.     }
  55.  
  56.     /**
  57.      * Gets an image that may be used to visually represent this bean
  58.      * (in the toolbar, on a form, etc).
  59.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  60.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  61.      * @return an image for this bean, always color even if requested monochrome
  62.      * @see BeanInfo#ICON_MONO_16x16
  63.      * @see BeanInfo#ICON_COLOR_16x16
  64.      * @see BeanInfo#ICON_MONO_32x32
  65.      * @see BeanInfo#ICON_COLOR_32x32
  66.      */
  67.     public java.awt.Image getIcon(int iconKind) {
  68.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  69.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  70.             java.awt.Image img = loadImage("LabelHTMLLinkC16.gif");
  71.             return img;
  72.         }
  73.  
  74.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  75.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  76.             java.awt.Image img = loadImage("LabelHTMLLinkC32.gif");
  77.             return img;
  78.         }
  79.  
  80.         return null;
  81.     }
  82.  
  83.     public MethodDescriptor[] getMethodDescriptors() {
  84.         return new MethodDescriptor[0];
  85.     }
  86.  
  87.     public PropertyDescriptor[] getPropertyDescriptors() {
  88.         return new PropertyDescriptor[0];
  89.     }
  90.     private final static Class beanClass = LabelHTMLLink.class;
  91.  
  92.     }    //  end of class LabelHTMLLinkBeanInfo